![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The class to handle all goose population related matters. More...
#include <Goose_Population_Manager.h>
Public Member Functions | |
Goose_Population_Manager (Landscape *L) | |
Goose_Population_Manager Constructor. More... | |
virtual | ~Goose_Population_Manager (void) |
Goose_Population_Manager Destructor. More... | |
int | GetDayTime () |
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0. Hence this function returns the number of minutes since sunrise. More... | |
int | GetDaylightLeft () |
Get the daylight minutes left today. More... | |
int | GetIsDaylight () |
Is it daylight hours? Daylight starts at m_daytime == 0. More... | |
bool | InPinkfootSeason () |
Are we in the pinkfoot hunting season? More... | |
bool | InGreylagSeason () |
Are we in the greylag hunting season? More... | |
void | CreateObjects (int ob_type, TAnimal *pvo, struct_Goose *data, int number) |
Method for creating a new individual Goose. More... | |
int | ForageLocationInUse (int a_polyref) |
Tests if a forage location is currently in use, if so returns the index to it. More... | |
void | AddGeeseToForageLocationP (GooseSpeciesType a_type, int a_polyref, int a_number) |
Adds a goose or geese to the forage location - uses polygon number as reference. More... | |
void | AddGeeseToForageLocation (GooseSpeciesType a_type, int a_index, int a_number) |
Adds a goose or geese to the forage location - requires an index. More... | |
void | RemoveGeeseFromForageLocation (GooseSpeciesType a_type, int a_index, int a_number) |
Removes a goose or geese to the forage location - requires an index. More... | |
int | NewForageLocation (GooseSpeciesType a_type, int a_number, int a_polyref) |
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to the forage location list. More... | |
GooseActiveForageLocation * | GetForageLocation (unsigned int a_index) |
Returns a pointer to the forage location indexed by index. More... | |
double | GetFeedingRate (double a_graindensity, GooseSpecies a_species) |
Get the forage rate based on the grain density. More... | |
double | GetMaizeFeedingRate (double a_maizedensity, GooseSpecies a_species) |
Get the forage rate when feeding on maize. More... | |
double | GetForageRateDensity (double a_foragedensity) |
Get the forage intake rate for a forage density. More... | |
double | GetForageGooseDensity (int a_index) |
Returns the total goose density for a forage location. More... | |
double | GetForageGrazing (int a_index, int gs) |
Returns the forage density for a forage location and goose type. This is species specific. More... | |
double | GetGrainDensity (int a_index) |
Returns the forage density for a forage location. More... | |
double | GetMaizeDensity (int a_index) |
Returns the maize forage density for a forage location. More... | |
void | RemoveGrainKJ (double a_kJ, int a_index) |
Removes kJ eaten as grains from a forage area. More... | |
void | RemoveMaizeKJ (double a_kJ, int a_index) |
Removes KJ eaten as maize from a forage area. More... | |
void | Graze (double a_kJ, int a_index) |
Removes KJ as grams veg biomass from a forage area. More... | |
void | RemoveMaxForageKj (double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex) |
Removes the forage eaten from the field. More... | |
int | GetBirdsAtForageLoc (int a_index, GooseSpeciesType a_type) |
Returns the number of birds at a forage location - given by a poly ref. More... | |
int | BirdsToShootAtPoly (int a_poly) |
Returns the number of birds at a forage location - given by a poly ref. More... | |
void | BirdsShot (int a_polyref, int a_numbershot, GooseHunter *a_Hunter) |
Passes the message to shoot a number of birds at a forage location. More... | |
void | BangAtPoly (int a_polyref) |
Passes a 'Bang' message to birds near to the location specified by the polygon reference. More... | |
Goose_Base * | GetLeader (APoint a_homeloc, GooseSpecies a_species) |
Asks for a pointer to a goose that can be followed. More... | |
void | FindClosestRoost (int &a_x, int &a_y, unsigned a_type) |
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y. More... | |
double | GetDistToClosestRoost (int a_x, int a_y, unsigned a_type) |
Returns the distance in to the nearest roost of a_type in meters. More... | |
double | GetThermalCosts (GooseSpecies a_goose) |
Get daily thermal costs const. More... | |
int | GetNumberOfForageLocs (void) |
Get the number of forage locations. More... | |
int | GetForageLocIndex (GooseSpecies a_species, int a_x, int a_y) |
Get a forage location for my species (picked randomly among the active locations) More... | |
void | RecordIndForageLoc (double a_count, int a_groupsize, GooseSpecies a_species) |
Record a forage location count. More... | |
void | RecordWeight (double a_weight, GooseSpecies a_species) |
Record the weight. More... | |
void | RecordHabitatUse (int a_habitatype, GooseSpecies a_species, int a_count) |
Record the habitat use. More... | |
void | RecordHabitatUseFieldObs (int a_habitatype, GooseSpecies a_species, int a_count) |
Record the habitat use. More... | |
void | RecordForagingTime (int a_time, GooseSpecies a_species) |
Record the time spent foraging. More... | |
void | RecordFlightDistance (int a_distance, GooseSpecies a_species) |
Record the flight distance. More... | |
void | RecordDailyEnergyBudget (int a_deb, GooseSpecies a_species) |
Record the daily energy budget. More... | |
void | RecordDailyEnergyBalance (int a_balance, GooseSpecies a_species) |
Record the daily energy balance. More... | |
void | RecordState () |
Record the state. More... | |
void | RecordLeaveReason (TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype) |
Record the reason for leaving. More... | |
![]() | |
Population_Manager (Landscape *L) | |
virtual | ~Population_Manager (void) |
void | SetNoProbes (int a_pn) |
unsigned | GetLiveArraySize (int a_listindex) |
Gets the number of 'live' objects for a list index in the TheArray. More... | |
void | IncLiveArraySize (int a_listindex) |
Increments the number of 'live' objects for a list index in the TheArray. More... | |
virtual void | Catastrophe (int) |
unsigned int | FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal) |
char * | SpeciesSpecificReporting (int a_species, int a_time) |
char * | ProbeReport (int a_time) |
char * | ProbeReportTimed (int a_time) |
void | ImpactProbeReport (int a_Time) |
bool | BeginningOfMonth () |
void | LOG (const char *fname) |
int | SupplyStepSize () |
int | SupplySimW () |
int | SupplySimH () |
virtual void | Run (int NoTSteps) |
virtual float | Probe (int ListIndex, probe_data *p_TheProbe) |
virtual void | ImpactedProbe () |
int | SupplyListNameLength () |
TAnimal * | SupplyAnimalPtr (int a_index, int a_animal) |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More... | |
unsigned | SupplyListIndexSize () |
unsigned | SupplyListSize (unsigned listindex) |
bool | CheckXY (int l, int i) |
Debug method to test for out of bounds coordinates. More... | |
const char * | SupplyListName (int i) |
bool | IsLast (unsigned listindex) |
int | SupplyState (unsigned listindex, unsigned j) |
virtual void | SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y) |
const char * | SupplyStateNames (int i) |
unsigned | SupplyStateNamesLength () |
virtual void | DisplayLocations () |
int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
TAnimal * | FindClosest (int x, int y, unsigned Type) |
bool | OpenTheRipleysOutputProbe (string a_NWordFilename) |
void | OpenTheAOROutputProbe (string a_AORFilename) |
bool | OpenTheMonthlyRipleysOutputProbe () |
bool | OpenTheReallyBigProbe () |
virtual void | TheReallyBigOutputProbe () |
void | CloseTheMonthlyRipleysOutputProbe () |
TTypesOfPopulation | GetPopulationType () |
int | GetSeasonNumber () |
Get the season number. More... | |
void | LamdaDeath (int x, int y) |
void | LamdaBirth (int x, int y) |
void | LamdaBirth (int x, int y, int z) |
void | LamdaClear () |
void | LamdaDumpOutput () |
virtual int | SupplyPegPosx (int) |
virtual int | SupplyPegPosy (int) |
virtual int | SupplyCovPosx (int) |
virtual int | SupplyCovPosy (int) |
virtual bool | OpenTheFledgelingProbe () |
virtual bool | OpenTheBreedingPairsProbe () |
virtual bool | OpenTheBreedingSuccessProbe () |
virtual void | BreedingPairsOutput (int) |
virtual int | TheBreedingFemalesProbe (int) |
virtual int | TheFledgelingProbe () |
virtual void | BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int) |
virtual int | TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &) |
virtual void | FledgelingProbeOutput (int, int) |
virtual void | TheGeneticProbe (unsigned, int, unsigned &) |
virtual void | GeneticsResultsOutput (FILE *, unsigned) |
Public Attributes | |
std::vector< GooseActiveForageLocation > | m_GooseForageLocations |
Is a list of active goose forage locations where we have geese. More... | |
Variate_gen * | m_variate_generator |
Function to be able to draw randomly from predefined distributions. More... | |
![]() | |
int | IndexArrayX [5][10000] |
probe_data * | TheProbe [100] |
int | SimH |
int | SimW |
unsigned | SimHH |
unsigned | SimWH |
char | m_SimulationName [255] |
bool | ProbesSet |
Landscape * | m_TheLandscape |
Protected Member Functions | |
virtual void | Init (void) |
Called upon initialization of the simulation. Sets up output files. More... | |
virtual void | DoFirst (void) |
Things to do before anything else at the start of a timestep. More... | |
virtual void | DoBefore () |
Things to do before the Step. More... | |
virtual void | DoAfter () |
Things to do before the EndStep. More... | |
virtual void | DoLast () |
Things to do after the EndStep. More... | |
virtual void | DoImmigration () |
Controls immigration to the Danish simulation area. More... | |
virtual void | DoEmigration () |
Controls emigration from the Danish simulation area. More... | |
void | GoosePopulationDescriptionOutput () |
Produces output to a standard file describing the state of the goose populations. More... | |
void | GooseFieldForageInfoOutput () |
Produces output to a standard file describing the energetic state of all individuals of the goose populations. More... | |
void | GooseEnergyRecordOutput () |
Produces output to a standard file describing the number of birds foraging at each field and the field conditions. More... | |
void | GooseWeightStatOutput () |
Outputs simple stats for the weights in the population. More... | |
void | GooseIndLocCountOutput () |
Outputs simple stats for the number of forage locations visited per goose. More... | |
void | GooseHabitatUseOutput () |
Outputs simple stats for the goose habitat use. More... | |
void | GooseHabitatUseFieldObsOutput () |
Outputs simple stats for the goose habitat use but using rules to mimic field observations. More... | |
void | ClearIndLocCountStats () |
Clear simple stats for forage location counts. More... | |
void | ClearGooseWeightStats () |
Clear simple stats for the weights in the population. More... | |
void | ClearGooseHabitatUseStats () |
Clear simple stats for habitat use. More... | |
void | ClearGooseHabitatUseFieldObsStats () |
Clear simple stats for field obs habitat use. More... | |
void | ClearGooseForagingTimeStats () |
Clear simple stats for foraging times in the population. More... | |
void | ClearGooseFlightDistanceStats () |
Clear simple stats for flight distances in the population. More... | |
void | ClearGooseDailyEnergyBudgetStats () |
Clear simple stats for daily energy budget in the population. More... | |
void | ClearGooseDailyEnergyBalanceStats () |
Clear simple stats for daily energy balance in the population. More... | |
void | ClearStateStats () |
Clear simple stats for the states. More... | |
void | StateStatOutput () |
Write simple stats for the states. More... | |
void | GooseLeaveReasonStatOutput () |
Outputs simple stats for the reasons for leaving the simulation. More... | |
void | ClearGooseLeaveReasonStats () |
Clear simple stats for the reasons for leaving the simulation. More... | |
void | ObservedOpennessQuery () |
Writes a file with the openness scores on places where geese have been observed in the field. More... | |
void | WriteConfig () |
Writes a file the values of the config variables used. More... | |
void | GetImmigrationNumbers (GooseSpecies a_goose, bool a_season) |
Get the numbers to immigrate. More... | |
bool | InHuntingSeason (int a_day, GooseSpecies a_species) |
Are we in the hunting season? More... | |
void | WriteHeaders (ofstream *a_file, std::vector< std::string > a_headers) |
Handy function for writing headers. More... | |
virtual void | TheAOROutputProbe () |
The modified goose version of the standard output for creating AOR statistics. More... | |
virtual void | TheRipleysOutputProbe (FILE *) |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
virtual void | CloseTheRipleysOutputProbe () |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
virtual void | CloseTheReallyBigOutputProbe () |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
void | XYDump () |
Outputs x y data. More... | |
std::string | GooseTypeToString (GooseSpeciesType a_gst) |
Translates gst enum to string More... | |
std::string | GooseToString (GooseSpecies a_gs) |
Translates gs enum to string More... | |
std::string | IntakeSourceToString (TTypeOfMaxIntakeSource a_intake_source) |
Translates tomis enum to string More... | |
std::string | LeaveReasonToString (TTypeOfLeaveReason a_leave_reason) |
Translates tolr enum to string More... | |
![]() | |
virtual bool | StepFinished () |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More... | |
virtual void | DoAlmostLast () |
void | EmptyTheArray () |
Removes all objects from the TheArray by deleting them and clearing TheArray. More... | |
void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
unsigned | PartitionLiveDead (unsigned Type) |
void | Shuffle_or_Sort (unsigned Type) |
void | Shuffle (unsigned Type) |
virtual void | Catastrophe () |
Protected Attributes | |
int | m_daytime |
Holds the time of day. Note that sunrise is at m_daytime == 0. More... | |
bool | m_daylight |
Flag for in daylight hours. Sunrise is always at m_daytime == 0. More... | |
int | m_daylightleft |
Number of daylight minutes left. More... | |
double | m_thermalcosts [3] |
Temporary storage for daily goose energetic thermal costs constant for each species. More... | |
std::vector< int > | m_youngdist |
The observed distribution of young for pink feet. More... | |
int | m_migrationnumbers [3][2] |
Storage for goose numbers. Used when birds are immigrating. More... | |
bool | m_PinkfootSeason |
Flag to indicate if we are in the pinkfoot hunting season? More... | |
bool | m_GreylagSeason |
Flag to indicate if we are in the greylag hunting season. More... | |
std::vector< roostlist > | m_roosts |
The list of roosts More... | |
HollingsDiscCurveClass * | m_IntakeRateVSGrainDensity_PF |
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2. More... | |
HollingsDiscCurveClass * | m_IntakeRateVSMaizeDensity_BN |
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2. More... | |
PettiforFeedingTimeCurveClass * | m_ForageRateVSGooseDensity |
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2. More... | |
ofstream * | m_GoosePopDataFile |
Pointer to an output file for goose population data. More... | |
ofstream * | m_GooseEnergeticsDataFile |
Pointer to an output file for goose energetics data. More... | |
ofstream * | m_GooseHabitatUseFile |
Pointer to an output file for goose habitat use data. More... | |
ofstream * | m_GooseHabitatUseFieldObsFile |
Pointer to an output file for goose habitat use data, field observation mimic version. More... | |
ofstream * | m_GooseIndLocCountFile |
Pointer to an output file for goose individual forage location count data. More... | |
ofstream * | m_GooseWeightStatsFile |
Pointer to an output file for goose weight stats data. More... | |
ofstream * | m_GooseLeaveReasonStatsFile |
Pointer to an output file for goose leave reason stats data. More... | |
ofstream * | m_GooseFieldForageDataFile |
Pointer to an output file for goose field forage data. More... | |
ofstream * | m_GooseGitVersionFile |
Pointer to an output file for almass version. More... | |
int | m_HabitatUseStats [gs_foobar *tomis_foobar] |
Data for the habitat use. More... | |
int | m_HabitatUseFieldObsStats [gs_foobar *tomis_foobar] |
Data for the habitat use, field observation mimic version. More... | |
SimpleStatistics | m_IndividualForageLocationData [gs_foobar] |
Statistics for the number of forage locations visited per goose of the population. More... | |
SimpleStatistics | m_WeightStats [gs_foobar] |
Statistics for the weights of the population. More... | |
SimpleStatistics | m_ForagingTimeStats [gs_foobar] |
Statistics for the time spent foraging for the population. More... | |
SimpleStatistics | m_FlightDistanceStats [gs_foobar] |
Statistics for the flight distances in the population. More... | |
SimpleStatistics | m_DailyEnergyBudgetStats [gs_foobar] |
Statistics for the daily energy budget in the population. More... | |
SimpleStatistics | m_DailyEnergyBalanceStats [gs_foobar] |
Statistics for the daily energy balance in the population. More... | |
ofstream * | m_StateStatsFile |
Pointer to an output file for state stats data. More... | |
SimpleStatistics | m_StateStats |
Debugging code. Statistics for the number of times a state method is called. More... | |
SimpleStatistics | m_LeaveReasonStats [gst_foobar][tolr_foobar] |
Statistics for reasons for leaving the simulation. More... | |
AOR_Probe_Goose * | m_AOR_Pinkfeet |
AOR Probe for pinkfeet. More... | |
AOR_Probe_Goose * | m_AOR_Barnacles |
AOR Probe for barnacles. More... | |
AOR_Probe_Goose * | m_AOR_Greylags |
AOR Probe for greylags. More... | |
ofstream * | m_GooseXYDumpFile |
Pointer to an output file for goose x y data. More... | |
![]() | |
vector< unsigned > | m_LiveArraySize |
int | m_NoProbes |
AOR_Probe * | m_AOR_Probe |
FILE * | m_GeneticsFile |
FILE * | m_AlleleFreqsFile |
FILE * | m_EasyPopRes |
const char * | StateNames [100] |
int | m_catastrophestartyear |
int | m_StepSize |
vector< TListOfAnimals > | TheArray |
unsigned | StateNamesLength |
const char * | m_ListNames [32] |
unsigned | m_ListNameLength |
FILE * | TestFile |
FILE * | TestFile2 |
unsigned | BeforeStepActions [12] |
int | m_SeasonNumber |
Holds the season number. Used when running goose and hunter sims. More... | |
TTypesOfPopulation | m_population_type |
ofstream * | AOROutputPrb |
FILE * | RipleysOutputPrb |
FILE * | RipleysOutputPrb1 |
FILE * | RipleysOutputPrb2 |
FILE * | RipleysOutputPrb3 |
FILE * | RipleysOutputPrb4 |
FILE * | RipleysOutputPrb5 |
FILE * | RipleysOutputPrb6 |
FILE * | RipleysOutputPrb7 |
FILE * | RipleysOutputPrb8 |
FILE * | RipleysOutputPrb9 |
FILE * | RipleysOutputPrb10 |
FILE * | RipleysOutputPrb11 |
FILE * | RipleysOutputPrb12 |
FILE * | ReallyBigOutputPrb |
long int | lamdagrid [2][257][257] |
The class to handle all goose population related matters.
Goose_Population_Manager::Goose_Population_Manager | ( | Landscape * | L | ) |
Goose_Population_Manager Constructor.
Set up before step action sorts This determines how we handle the arrays between steps
There is a mandatory file for goose populations that describe the roost locations for each goose type in the landscape - GooseRoosts.txt For each type of goose the x,y locations for roosts are listed
Read in a file with the distribution of the brood sizes as observed from the field. We only have data from Pinkfeet, so this distribution is recycled for the other species
Create curves for food intake rates and forage rates
References Population_Manager::BeforeStepActions, cfg_goose_bn_FieldForageDist, cfg_goose_bn_followinglikelyhood, cfg_goose_bn_ForageDist, cfg_goose_EnergyContentOfFat, cfg_goose_flightcost, cfg_goose_gl_FieldForageDist, cfg_goose_gl_followinglikelyhood, cfg_goose_gl_ForageDist, cfg_goose_LeavingThreshold, cfg_goose_MaxAppetiteScaler, cfg_goose_MaxEnergyReserveProportion, cfg_goose_MetabolicConversionCosts, cfg_goose_MinForageOpenness, cfg_goose_ModelExitDay, cfg_goose_pf_FieldForageDist, cfg_goose_pf_followinglikelyhood, cfg_goose_pf_ForageDist, cfg_goose_RoostLeaveDistMean, cfg_goose_RoostLeaveDistSD, cfg_H1A, cfg_H1B, cfg_H1C, cfg_H1D, cfg_H1E, cfg_H1F, cfg_H2A, cfg_H2B, cfg_H2C, cfg_H2D, cfg_H2E, cfg_H2F, cfg_Petti1A, cfg_Petti1B, cfg_Petti1C, cfg_Petti1D, cfg_Petti1E, cfg_Petti1F, cfg_Petti1G, cfg_WriteCurve, g_torun, gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Init(), m_daytime, m_ForageRateVSGooseDensity, m_GreylagSeason, m_IntakeRateVSGrainDensity_PF, m_IntakeRateVSMaizeDensity_BN, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, m_PinkfootSeason, Population_Manager::m_population_type, m_roosts, Population_Manager::m_SimulationName, Population_Manager::m_TheLandscape, m_thermalcosts, m_variate_generator, APoint::m_x, APoint::m_y, m_youngdist, Goose_Base::Set_GooseFattoKJConversion(), Goose_Base::Set_GooseFieldForageDist(), Goose_Base::Set_GooseFollowingLikelyhood(), Goose_Base::Set_GooseForageDist(), Goose_Base::Set_GooseKJtoFatConversion(), Goose_Base::Set_GooseLeavingRoost(), Goose_Base::Set_GooseLeavingThreshold(), Goose_Base::Set_GooseMaxAppetiteScaler(), Goose_Base::Set_GooseMaxEnergyReserveProportion(), Goose_Base::Set_GooseMinForageOpenness(), Goose_Base::Set_Indivmingooseforagerate(), Goose_Base::Set_mingooseforagerate(), Goose_Base::SetFlightCost(), Population_Manager::TheArray, TOP_Goose, CfgInt::value(), CfgFloat::value(), CfgBool::value(), CfgStr::value(), Landscape::Warn(), and CurveClass::WriteDataFile().
|
virtual |
Goose_Population_Manager Destructor.
Close files and delete pointers to them
Delete any memory constructs created by new
References cfg_AOROutput_used, l_map_print_git_version_info, m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, m_ForageRateVSGooseDensity, m_GooseEnergeticsDataFile, m_GooseFieldForageDataFile, m_GooseGitVersionFile, m_GooseHabitatUseFieldObsFile, m_GooseHabitatUseFile, m_GooseIndLocCountFile, m_GoosePopDataFile, m_GooseWeightStatsFile, m_GooseXYDumpFile, m_IntakeRateVSGrainDensity_PF, m_IntakeRateVSMaizeDensity_BN, m_variate_generator, and CfgBool::value().
void Goose_Population_Manager::AddGeeseToForageLocation | ( | GooseSpeciesType | a_type, |
int | a_index, | ||
int | a_number | ||
) |
Adds a goose or geese to the forage location - requires an index.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation().
void Goose_Population_Manager::AddGeeseToForageLocationP | ( | GooseSpeciesType | a_type, |
int | a_polyref, | ||
int | a_number | ||
) |
Adds a goose or geese to the forage location - uses polygon number as reference.
f First step is to get the forage location - then add the number of birds of a_type to it.
References ForageLocationInUse(), m_GooseForageLocations, and NewForageLocation().
void Goose_Population_Manager::BangAtPoly | ( | int | a_polyref | ) |
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
Here we have to find all the geese that are near to this polygon - then tell them they are scared of this location. Unfortunately there is no easy way to do this except trawl through all geese and test the distance they are from the bang at the moment this method is called. We assume the bang occurs at the centroid since we do not have a particular location for this within the polygon. Centroid distance to the location of each bird is checked and if under the maximum threat distance then we tell the bird they are scared. An alternative approach would be to link the size of scare to the distance. This is provided as an alternative assuming __LINKGOOSESCARETODISTANCE is defined.
References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), cfg_goose_MaxScareDistance, g_AlmassMathFuncs, Population_Manager::m_ListNameLength, Population_Manager::m_TheLandscape, APoint::m_x, APoint::m_y, Goose_Base::On_Bang(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Population_Manager::TheArray, and CfgInt::value().
Referenced by GooseHunter::st_OutHunting().
void Goose_Population_Manager::BirdsShot | ( | int | a_polyref, |
int | a_numbershot, | ||
GooseHunter * | a_Hunter | ||
) |
Passes the message to shoot a number of birds at a forage location.
First step is to get the forage location - the we pick a_numbershot birds to kill. This is a bit problematic since we know the type of birds but not exactly which ones are here. To speed things up as much as possible we first determine which birds will be shot by picking randomly from the birds here. Next we need to make some 'BANG's and scare the birds away from this location and nearby locations. Note that barnacle geese cannot be shot and are excluded by the loop below.
References ForageLocationInUse(), g_land, g_msg, g_rand_uni, Population_Manager::GetLiveArraySize(), gst_foobar, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, InGreylagSeason(), InPinkfootSeason(), m_GooseForageLocations, m_GreylagSeason, m_PinkfootSeason, GooseHunter::OnShotABird(), Landscape::SupplyDayInYear(), Landscape::SupplyYear(), Population_Manager::TheArray, and MapErrorMsg::Warn().
Referenced by GooseHunter::OnShoot(), and GooseHunter::st_OutHunting().
int Goose_Population_Manager::BirdsToShootAtPoly | ( | int | a_poly | ) |
Returns the number of birds at a forage location - given by a poly ref.
Assumes that a_protectedpct is initialised to 0.0 on entry. First step is to get the forage location - the find out how many birds are there.
References ForageLocationInUse(), g_msg, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, InGreylagSeason(), InPinkfootSeason(), m_GooseForageLocations, and MapErrorMsg::Warn().
Referenced by GooseHunter::OnShoot(), and GooseHunter::st_OutHunting().
|
protected |
Clear simple stats for daily energy balance in the population.
References m_DailyEnergyBalanceStats.
Referenced by DoLast().
|
protected |
Clear simple stats for daily energy budget in the population.
References m_DailyEnergyBudgetStats.
Referenced by DoLast().
|
protected |
Clear simple stats for flight distances in the population.
References m_FlightDistanceStats.
Referenced by DoLast().
|
protected |
Clear simple stats for foraging times in the population.
References m_ForagingTimeStats.
Referenced by DoLast().
|
protected |
Clear simple stats for field obs habitat use.
References m_HabitatUseFieldObsStats, and tomis_foobar.
Referenced by GooseHabitatUseFieldObsOutput(), and Init().
|
protected |
Clear simple stats for habitat use.
References m_HabitatUseStats, and tomis_foobar.
Referenced by GooseHabitatUseOutput(), and Init().
|
protected |
Clear simple stats for the reasons for leaving the simulation.
References SimpleStatistics::ClearData(), gst_foobar, m_LeaveReasonStats, and tolr_foobar.
Referenced by DoLast().
|
protected |
Clear simple stats for the weights in the population.
References m_WeightStats.
Referenced by DoLast().
|
protected |
Clear simple stats for forage location counts.
References m_IndividualForageLocationData.
Referenced by DoLast().
|
protected |
Clear simple stats for the states.
References SimpleStatistics::ClearData(), and m_StateStats.
Referenced by DoLast().
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Reimplemented from Population_Manager.
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Reimplemented from Population_Manager.
void Goose_Population_Manager::CreateObjects | ( | int | ob_type, |
TAnimal * | pvo, | ||
struct_Goose * | data, | ||
int | number | ||
) |
Method for creating a new individual Goose.
References Population_Manager::GetLiveArraySize(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Population_Manager::IncLiveArraySize(), struct_Goose::m_GPM, struct_Goose::m_grpsize, struct_Goose::m_L, struct_Goose::m_roost, struct_Goose::m_sex, Population_Manager::m_TheLandscape, struct_Goose::m_weight, Goose_Barnacle_NonBreeder::ReInit(), Goose_Greylag_NonBreeder::ReInit(), Goose_Pinkfoot_NonBreeder::ReInit(), Goose_Barnacle_FamilyGroup::ReInit(), Goose_Greylag_FamilyGroup::ReInit(), Goose_Pinkfoot_FamilyGroup::ReInit(), Population_Manager::TheArray, and Landscape::Warn().
Referenced by DoImmigration().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
protectedvirtual |
Controls emigration from the Danish simulation area.
References cfg_goose_bn_fallmig_probability, cfg_goose_bn_fallmigdateend, cfg_goose_bn_fallmigdatestart, cfg_goose_bn_fallmigrate, cfg_goose_bn_leavingdateend, cfg_goose_bn_leavingdatestart, cfg_goose_gl_fallmig_probability, cfg_goose_gl_fallmigdateend, cfg_goose_gl_fallmigdatestart, cfg_goose_gl_fallmigrate, cfg_goose_gl_leavingdateend, cfg_goose_gl_leavingdatestart, cfg_goose_pf_fallmig_probability, cfg_goose_pf_fallmigdateend, cfg_goose_pf_fallmigdatestart, cfg_goose_pf_fallmigrate, cfg_goose_pf_leavingdateend, cfg_goose_pf_leavingdatestart, g_rand_uni, Population_Manager::GetLiveArraySize(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::TheArray, CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by DoFirst().
|
protectedvirtual |
Things to do before anything else at the start of a timestep.
The Goose_Population_Manager DoFirst has three main functions. The first is to control the variables related to the goose timestep of 10 minutes. Here we assume the daylight hours start at time 0 and go on until the end of the daylength at any given date.
Then, if we are at start of day, then max goose numbers are relayed to the field elements.
Next checks the date and determines if we need to either migrate out of the area or into the area. If so calls the appropriate immigration or emigration code. Otherwise if we are in normal Danish simulation mode then at the start of each day the list of active forage locations is emptied ready to be refilled as the geese start foraging and some global energetic constants are calculated (thermal regulation costs).
Reimplemented from Population_Manager.
References cfg_goose_bn_Thermalconstant, cfg_goose_gl_Thermalconstant, cfg_goose_grain_and_maize_reset_day, cfg_goose_pf_Thermalconstant, cfg_goose_Thermalconstantb, DoEmigration(), DoImmigration(), InHuntingSeason(), m_daylight, m_daylightleft, m_daytime, m_GooseForageLocations, m_GreylagSeason, m_PinkfootSeason, Population_Manager::m_TheLandscape, m_thermalcosts, Landscape::ResetGrainAndMaize(), Landscape::SupplyDayInYear(), Landscape::SupplyDaylength(), Landscape::SupplyTemp(), CfgInt::value(), and CfgFloat::value().
|
protectedvirtual |
Controls immigration to the Danish simulation area.
Here we need to determine the inputs in terms of birds to the Danish simulation area and create all the necessary objects and object relationships. This is a tiny bit tricky since it is important that all birds start the simulation with a sensible and complete characteristics.
The first step is to determine whether there are birds of each type to immigrate today, and if so how many. We have the numbers to immigrate and the range of days over which this happens. For sake of simplicity and because we don't have other information we will assume an even distribution of birds over this period.
Pinkfoot spring migration
Barnacle spring migration
Greylag spring migration
References cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_baseweight, cfg_goose_bn_leavingdateend, cfg_goose_bn_sexratio, cfg_goose_bn_springmigdateend, cfg_goose_bn_springmigdatestart, cfg_goose_bn_springmigrate, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_baseweight, cfg_goose_gl_leavingdateend, cfg_goose_gl_sexratio, cfg_goose_gl_springmigdateend, cfg_goose_gl_springmigdatestart, cfg_goose_gl_springmigrate, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_baseweight, cfg_goose_pf_leavingdateend, cfg_goose_pf_sexratio, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, cfg_goose_pf_springmigrate, CreateObjects(), g_rand_uni, GetImmigrationNumbers(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, struct_Goose::m_family, struct_Goose::m_GPM, struct_Goose::m_grpsize, struct_Goose::m_L, m_migrationnumbers, struct_Goose::m_roost, m_roosts, Population_Manager::m_SeasonNumber, struct_Goose::m_sex, Population_Manager::m_TheLandscape, struct_Goose::m_weight, APoint::m_x, struct_Goose::m_x, APoint::m_y, struct_Goose::m_y, m_youngdist, random(), Landscape::SupplyDayInYear(), CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by DoFirst().
|
protectedvirtual |
Things to do after the EndStep.
The first job of DoLast is to update grain status in the forage locations.
If it is end of day, then max goose numbers are relayed to the field elements, then to inform the landscape of changes in grain and maize densities as a result of goose feeding. This is done here rather than have the geese interact directly with the landscape elements for efficiency, since landscape elements will only be updated once a day, and after the geese are finished. This also means fewer calculations and indirections.
If there is no grain or maize to deplete this does nothing.
Reimplemented from Population_Manager.
References cfg_goose_EnergyRecord, cfg_goose_FieldForageInfo, cfg_goose_IndLocCounts, cfg_goose_LeaveReasonStats, cfg_goose_PopulationDescriptionON, cfg_goose_StateStats, cfg_goose_TimedCounts, cfg_goose_WeightStats, cfg_gooseHabitatUsetime, ClearGooseDailyEnergyBalanceStats(), ClearGooseDailyEnergyBudgetStats(), ClearGooseFlightDistanceStats(), ClearGooseForagingTimeStats(), ClearGooseLeaveReasonStats(), ClearGooseWeightStats(), ClearIndLocCountStats(), ClearStateStats(), g_date, Calendar::GetDayInMonth(), GetDayTime(), GetGrainDensity(), Goose_Base::GetGroupsize(), Population_Manager::GetLiveArraySize(), GetMaizeDensity(), Goose_Base::GetMaxIntakeSource(), Goose_Base::GetSpecies(), GooseEnergyRecordOutput(), GooseFieldForageInfoOutput(), GooseHabitatUseFieldObsOutput(), GooseHabitatUseOutput(), GooseIndLocCountOutput(), GooseLeaveReasonStatOutput(), GoosePopulationDescriptionOutput(), GooseWeightStatOutput(), Landscape::GrazeVegetationTotal(), gst_foobar, m_daytime, m_GooseForageLocations, TMaxIntakeSource::m_instubble, TMaxIntakeSource::m_iscereal, TMaxIntakeSource::m_maxintakesource, TMaxIntakeSource::m_prevsowncrop, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, TMaxIntakeSource::m_veg, Landscape::RecordGooseNumbers(), Landscape::RecordGooseNumbersTimed(), Landscape::RecordGooseRoostDist(), Landscape::RecordGooseSpNumbers(), Landscape::RecordGooseSpNumbersTimed(), RecordHabitatUse(), RecordHabitatUseFieldObs(), Landscape::SetBirdMaizeForage(), Landscape::SetBirdSeedForage(), StateStatOutput(), Landscape::SupplyBirdMaizeForage(), Landscape::SupplyBirdSeedForage(), Landscape::SupplyDayInYear(), Landscape::SupplyDaylength(), Landscape::SupplyIsGrass2(), Population_Manager::TheArray, tomis_foobar, tomis_grain, tomis_grass, tomis_maize, tomis_sowncrop, tov_Maize, tov_MaizeSilage, CfgInt::value(), CfgBool::value(), and XYDump().
void Goose_Population_Manager::FindClosestRoost | ( | int & | a_x, |
int & | a_y, | ||
unsigned | a_type | ||
) |
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y.
References ALMaSS_MathFuncs::CalcDistPythagoras(), g_AlmassMathFuncs, and m_roosts.
Referenced by Goose_Barnacle_Base::ChangeRoost(), Goose_Greylag_Base::ChangeRoost(), and Goose_Pinkfoot_Base::ChangeRoost().
int Goose_Population_Manager::ForageLocationInUse | ( | int | a_polyref | ) |
Tests if a forage location is currently in use, if so returns the index to it.
[in] | a_polyref | is the polygon reference number that identifies the field for foraging |
References m_GooseForageLocations.
Referenced by AddGeeseToForageLocationP(), BirdsShot(), BirdsToShootAtPoly(), GetForageLocIndex(), and Goose_Base::st_ChooseForageLocation().
|
inline |
Returns the number of birds at a forage location - given by a poly ref.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
|
inline |
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0. Hence this function returns the number of minutes since sunrise.
References m_daytime.
Referenced by DoLast(), Goose_Base::st_ChooseForageLocation(), Goose_Base::st_Forage(), Goose_Base::st_Roost(), Goose_Base::StartDay(), and TheAOROutputProbe().
double Goose_Population_Manager::GetDistToClosestRoost | ( | int | a_x, |
int | a_y, | ||
unsigned | a_type | ||
) |
Returns the distance in to the nearest roost of a_type in meters.
References ALMaSS_MathFuncs::CalcDistPythagoras(), g_AlmassMathFuncs, and m_roosts.
Referenced by NewForageLocation().
|
inline |
Get the forage rate based on the grain density.
[in] | a_graindensity | The grain density (grain/m2) on the forage location |
[in] | a_species | The type of goose species |
Unpublished curve from Nolet. o:/ST_GooseProject/Field data/Fugledata/Functional response pink-feet.xlsx This curve has already taken digestibility, energy content and assimilation into account.
References CurveClass::GetY(), and m_IntakeRateVSGrainDensity_PF.
Referenced by Goose_Base::EvaluateForageToHopLoc(), Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the total goose density for a forage location.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the forage density for a forage location and goose type. This is species specific.
References m_GooseForageLocations.
|
inline |
Returns a pointer to the forage location indexed by index.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and XYDump().
int Goose_Population_Manager::GetForageLocIndex | ( | GooseSpecies | a_species, |
int | a_x, | ||
int | a_y | ||
) |
Get a forage location for my species (picked randomly among the active locations)
References ALMaSS_MathFuncs::CalcDistPythagoras(), cfg_goose_dist_weight_power, ForageLocationInUse(), g_AlmassMathFuncs, g_rand_uni, m_GooseForageLocations, Population_Manager::m_TheLandscape, random(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), and CfgFloat::value().
Referenced by Goose_Base::st_ChooseForageLocation(), and XYDump().
|
inline |
Get the forage intake rate for a forage density.
References CurveClass::GetY(), and m_ForageRateVSGooseDensity.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the forage density for a forage location.
References m_GooseForageLocations.
Referenced by DoLast().
|
protected |
Get the numbers to immigrate.
References cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_springmigdateend, cfg_goose_bn_springmigdatestart, cfg_goose_bn_springmignos, cfg_goose_bn_startnos, cfg_goose_bn_young_proportion, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_springmigdateend, cfg_goose_gl_springmigdatestart, cfg_goose_gl_springmignos, cfg_goose_gl_startnos, cfg_goose_gl_young_proportion, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, cfg_goose_pf_springmignos, cfg_goose_pf_startnos, cfg_goose_pf_young_proportion, m_migrationnumbers, start, CfgInt::value(), and CfgFloat::value().
Referenced by DoImmigration().
|
inline |
Is it daylight hours? Daylight starts at m_daytime == 0.
References m_daylight.
Referenced by Goose_Base::st_Roost().
Goose_Base * Goose_Population_Manager::GetLeader | ( | APoint | a_roost, |
GooseSpecies | a_species | ||
) |
Asks for a pointer to a goose that can be followed.
When leaving the roost in the morning we have the option to either follow another bird or go exploring on our own./n If we follow another bird this function will find a bird to follow (a leader). It is a prerequisite that the leader is from the same roost as the bird following and that the leader have found a suitable forage location.
[in] | a_roost | The roost of the follower as a point. |
[in] | a_species | The species of the follower. |
References Goose_Base::GetForageLocIndex(), Population_Manager::GetLiveArraySize(), Goose_Base::GetRoost(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, APoint::m_x, APoint::m_y, random(), start, and Population_Manager::TheArray.
Referenced by Goose_Base::st_ChooseForageLocation().
|
inline |
Returns the maize forage density for a forage location.
References m_GooseForageLocations.
Referenced by DoLast().
|
inline |
Get the forage rate when feeding on maize.
[in] | a_maizedensity | The maize density in kJ/m2 |
[in] | a_species | The type of goose species |
Functional response for geese feeding on maize is currently lacking. The curve used here is based on field observations of barnacle geese made with wildlife cameras in Jutland in 2015. Assimilation for energy is accounted for in the functional response curce. Value found for Bewick's swans from Nolet, B. unpubl. For greylag and pinkfeet the value is scaled based on the relationship between
References CurveClass::GetY(), and m_IntakeRateVSMaizeDensity_BN.
Referenced by Goose_Base::EvaluateForageToHopLoc(), Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
|
inline |
Get daily thermal costs const.
References m_thermalcosts.
Referenced by Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), and Goose_Base::StartDay().
|
protected |
Produces output to a standard file describing the number of birds foraging at each field and the field conditions.
References SimpleStatistics::get_meanvalue(), SimpleStatistics::get_SE(), GooseToString(), m_DailyEnergyBalanceStats, m_DailyEnergyBudgetStats, m_FlightDistanceStats, m_ForagingTimeStats, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyDaylength(), and Landscape::SupplyGlobalDate().
Referenced by DoLast().
|
protected |
Produces output to a standard file describing the energetic state of all individuals of the goose populations.
The information needed here is in the landscape. We need to trawl through all the fields and record those that have suitable openness scores and food for geese
References cfg_goose_MinForageOpenness, cfg_goose_runtime_reporting, Landscape::GetGooseFields(), Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyCentroidX(), Landscape::SupplyGlobalDate(), CfgFloat::value(), and CfgBool::value().
Referenced by DoLast().
|
protected |
Outputs simple stats for the goose habitat use but using rules to mimic field observations.
References ClearGooseHabitatUseFieldObsStats(), GooseToString(), m_HabitatUseFieldObsStats, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), and tomis_foobar.
Referenced by DoLast().
|
protected |
Outputs simple stats for the goose habitat use.
References ClearGooseHabitatUseStats(), GooseToString(), m_HabitatUseStats, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), and tomis_foobar.
Referenced by DoLast().
|
protected |
Outputs simple stats for the number of forage locations visited per goose.
References SimpleStatistics::get_meanvalue(), SimpleStatistics::get_N(), SimpleStatistics::get_SE(), GooseToString(), m_IndividualForageLocationData, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), and Landscape::SupplyGlobalDate().
Referenced by DoLast().
|
protected |
Outputs simple stats for the reasons for leaving the simulation.
References SimpleStatistics::get_N(), GooseTypeToString(), gst_foobar, LeaveReasonToString(), m_LeaveReasonStats, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), and tolr_foobar.
Referenced by DoLast().
|
protected |
Produces output to a standard file describing the state of the goose populations.
Here the first job is to correct the standard output and produce a more detailed description of the population, ie not counting families as one.
References Population_Manager::GetLiveArraySize(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, Landscape::SupplyGlobalDate(), Landscape::SupplySnowDepth(), and Population_Manager::TheArray.
Referenced by DoLast().
|
protected |
Translates gs enum to string
Referenced by GooseEnergyRecordOutput(), GooseHabitatUseFieldObsOutput(), GooseHabitatUseOutput(), GooseIndLocCountOutput(), and GooseWeightStatOutput().
|
protected |
Translates gst enum to string
References gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, and gst_PinkfootNonBreeder.
Referenced by GooseLeaveReasonStatOutput().
|
protected |
Outputs simple stats for the weights in the population.
References SimpleStatistics::get_meanvalue(), SimpleStatistics::get_N(), SimpleStatistics::get_SE(), GooseToString(), Population_Manager::m_SeasonNumber, Population_Manager::m_TheLandscape, m_WeightStats, Landscape::SupplyDayInYear(), and Landscape::SupplyGlobalDate().
Referenced by DoLast().
|
inline |
Removes KJ as grams veg biomass from a forage area.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
|
inline |
Are we in the greylag hunting season?
References m_GreylagSeason.
Referenced by BirdsShot(), BirdsToShootAtPoly(), and GooseActiveForageLocation::GetHuntables().
|
protected |
Are we in the hunting season?
The goose hunting season is complicated because it runs over a year boundary (or it can) Particularly the first year of the simulation is tricky, because we start out in January which can be legal hunting season, but the geese don't arrive until the fall.
References cfg_goose_greylagopenseasonend, cfg_goose_greylagopenseasonstart, cfg_goose_pinkfootopenseasonend, cfg_goose_pinkfootopenseasonstart, g_msg, Population_Manager::GetSeasonNumber(), CfgInt::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by DoFirst().
|
protectedvirtual |
Called upon initialization of the simulation. Sets up output files.
Finally opens any output files needed
References cfg_AOROutput_used, cfg_goose_ObservedOpennessQuery, cfg_goose_runtime_reporting, cfg_goose_WriteConfig, cfg_ReallyBigOutput_used, ClearGooseHabitatUseFieldObsStats(), ClearGooseHabitatUseStats(), IntakeSourceToString(), l_map_print_git_version_info, m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, m_GooseEnergeticsDataFile, m_GooseFieldForageDataFile, m_GooseGitVersionFile, m_GooseHabitatUseFieldObsFile, m_GooseHabitatUseFile, m_GooseIndLocCountFile, m_GooseLeaveReasonStatsFile, m_GoosePopDataFile, m_GooseWeightStatsFile, m_GooseXYDumpFile, m_StateStatsFile, Population_Manager::m_TheLandscape, ObservedOpennessQuery(), Population_Manager::OpenTheReallyBigProbe(), Population_Manager::ReallyBigOutputPrb, tomis_foobar, CfgBool::value(), WriteConfig(), and WriteHeaders().
Referenced by Goose_Population_Manager().
|
inline |
Are we in the pinkfoot hunting season?
References m_PinkfootSeason.
Referenced by BirdsShot(), BirdsToShootAtPoly(), and GooseActiveForageLocation::GetHuntables().
|
protected |
Translates tomis enum to string
References tomis_grain, tomis_grass, tomis_maize, and tomis_sowncrop.
Referenced by Init().
|
protected |
Translates tolr enum to string
References tolr_bodycondition, tolr_leanweight, tolr_migration, and tomis_grain.
Referenced by GooseLeaveReasonStatOutput().
int Goose_Population_Manager::NewForageLocation | ( | GooseSpeciesType | a_type, |
int | a_number, | ||
int | a_polyref | ||
) |
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to the forage location list.
[in] | a_type | is type of goose species to forage here in this first forage group |
[in] | a_number | is the number of geese in this first forarge group |
[in] | a_polyref | is the polygon reference number that identifies the field for foraging |
Adds the new forage location to the m_GooseForageLocations vector and adds the starting number of geese of the type specified. Calculates the distance to the closest roost for each species.
References Landscape::GetActualGooseGrazingForage(), GetDistToClosestRoost(), m_GooseForageLocations, Population_Manager::m_TheLandscape, GooseActiveForageLocation::ResetGrazing(), GooseActiveForageLocation::SetDistToClosestRoost(), Landscape::SupplyBirdMaizeForage(), Landscape::SupplyBirdSeedForage(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), and Landscape::SupplyPolygonArea().
Referenced by AddGeeseToForageLocationP(), and Goose_Base::st_ChooseForageLocation().
|
protected |
Writes a file with the openness scores on places where geese have been observed in the field.
Here locations of geese observed in the field are read in from a file and the openness score for those locations are written to a file.
References Population_Manager::m_TheLandscape, Landscape::PolytypeToString(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyElementType(), Landscape::SupplyOpenness(), Landscape::SupplyPolyRef(), and Landscape::Warn().
Referenced by Init().
void Goose_Population_Manager::RecordDailyEnergyBalance | ( | int | a_balance, |
GooseSpecies | a_species | ||
) |
Record the daily energy balance.
References SimpleStatistics::add_variable(), and m_DailyEnergyBalanceStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordDailyEnergyBudget | ( | int | a_deb, |
GooseSpecies | a_species | ||
) |
Record the daily energy budget.
References SimpleStatistics::add_variable(), and m_DailyEnergyBudgetStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordFlightDistance | ( | int | a_distance, |
GooseSpecies | a_species | ||
) |
Record the flight distance.
References SimpleStatistics::add_variable(), and m_FlightDistanceStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordForagingTime | ( | int | a_time, |
GooseSpecies | a_species | ||
) |
Record the time spent foraging.
References SimpleStatistics::add_variable(), and m_ForagingTimeStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordHabitatUse | ( | int | a_habitatype, |
GooseSpecies | a_species, | ||
int | a_count | ||
) |
void Goose_Population_Manager::RecordHabitatUseFieldObs | ( | int | a_habitatype, |
GooseSpecies | a_species, | ||
int | a_count | ||
) |
Record the habitat use.
References m_HabitatUseFieldObsStats, and tomis_foobar.
Referenced by DoLast().
void Goose_Population_Manager::RecordIndForageLoc | ( | double | a_count, |
int | a_groupsize, | ||
GooseSpecies | a_species | ||
) |
Record a forage location count.
References m_IndividualForageLocationData.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordLeaveReason | ( | TTypeOfLeaveReason | a_leavereason, |
GooseSpeciesType | a_speciestype | ||
) |
Record the reason for leaving.
References SimpleStatistics::add_variable(), and m_LeaveReasonStats.
Referenced by Goose_Base::On_Migrate().
void Goose_Population_Manager::RecordState | ( | ) |
Record the state.
References SimpleStatistics::add_variable(), and m_StateStats.
Referenced by Goose_Base::st_ChooseForageLocation().
void Goose_Population_Manager::RecordWeight | ( | double | a_weight, |
GooseSpecies | a_species | ||
) |
Record the weight.
References SimpleStatistics::add_variable(), and m_WeightStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RemoveGeeseFromForageLocation | ( | GooseSpeciesType | a_type, |
int | a_index, | ||
int | a_number | ||
) |
Removes a goose or geese to the forage location - requires an index.
References m_GooseForageLocations.
Referenced by Goose_Base::KillThis(), Goose_Barnacle_FamilyGroup::KillThis(), Goose_Greylag_FamilyGroup::KillThis(), Goose_Pinkfoot_FamilyGroup::KillThis(), Goose_Base::On_Bang(), Goose_Base::st_Forage(), Goose_Barnacle_Base::st_ToRoost(), Goose_Greylag_Base::st_ToRoost(), and Goose_Pinkfoot_Base::st_ToRoost().
|
inline |
Removes kJ eaten as grains from a forage area.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
|
inline |
Removes KJ eaten as maize from a forage area.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
void Goose_Population_Manager::RemoveMaxForageKj | ( | double | a_forage, |
TTypeOfMaxIntakeSource | a_maxintakesource, | ||
int | m_myForageIndex | ||
) |
Removes the forage eaten from the field.
[in] | a_forage | The forage to be removed in Kj |
[in] | a_maxintakesource | The source of the max intake |
[in] | m_myForageIndex | Temporary storage for a forage location index |
References Graze(), Population_Manager::m_TheLandscape, RemoveGrainKJ(), RemoveMaizeKJ(), tomis_foobar, tomis_grain, tomis_grass, tomis_maize, and Landscape::Warn().
Referenced by Goose_Base::st_Forage().
|
protected |
Write simple stats for the states.
References SimpleStatistics::get_N(), Population_Manager::m_SeasonNumber, m_StateStats, Population_Manager::m_TheLandscape, and Landscape::SupplyGlobalDate().
Referenced by DoLast().
|
protectedvirtual |
The modified goose version of the standard output for creating AOR statistics.
Here the problem is that we can't use the standard outputs because of the special goose population structures. So we need some special adaptions to the probe. This is done by extending the AOR_Probe class and using this, one for each species We also need to do this only once per day, so since the main calling loops use days as triggers we need to return doing nothing if the time is wrong.
Reimplemented from Population_Manager.
References cfg_gooseAORtime, AOR_Probe_Goose::DoProbe(), GetDayTime(), m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, and CfgInt::value().
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Reimplemented from Population_Manager.
|
protected |
Writes a file the values of the config variables used.
Write out the values of the configs used Handy when compiling the result documents
References cfg_goose_BMRconstant1, cfg_goose_BMRconstant2, cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_baseweight, cfg_goose_bn_followinglikelyhood, cfg_goose_bn_ForageDist, cfg_goose_bn_leavingdateend, cfg_goose_bn_leavingdatestart, cfg_goose_bn_sexratio, cfg_goose_bn_Thermalconstant, cfg_goose_daytime_BMR_multiplier, cfg_goose_dist_weight_power, cfg_goose_EnergyContentOfFat, cfg_goose_flightcost, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_baseweight, cfg_goose_gl_followinglikelyhood, cfg_goose_gl_ForageDist, cfg_goose_gl_leavingdateend, cfg_goose_gl_leavingdatestart, cfg_goose_gl_sexratio, cfg_goose_gl_Thermalconstant, cfg_goose_GrainDecayRateSpring, cfg_goose_GrainDecayRateWinter, cfg_goose_grass_to_winter_cereal_scaler, cfg_goose_InitialEnergyReserveProportion, cfg_goose_LeaveReasonStats, cfg_goose_MaxAppetiteScaler, cfg_goose_MaxEnergyReserveProportion, cfg_goose_MaxScareDistance, cfg_goose_MetabolicConversionCosts, cfg_goose_MinForageOpenness, cfg_goose_nighttime_BMR_multiplier, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_baseweight, cfg_goose_pf_followinglikelyhood, cfg_goose_pf_ForageDist, cfg_goose_pf_leavingdateend, cfg_goose_pf_leavingdatestart, cfg_goose_pf_sexratio, cfg_goose_pf_Thermalconstant, cfg_goose_roostchangechance, cfg_goose_RoostLeaveDistMean, cfg_goose_RoostLeaveDistSD, cfg_goose_snow_scaler, cfg_goose_Thermalconstantb, cfg_PermanentVegGrowthMaxScaler, cfg_PermanentVegGrowthMinScaler, CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by Init().
|
protected |
|
protected |
Outputs x y data.
References GetForageLocation(), GetForageLocIndex(), Population_Manager::GetLiveArraySize(), GooseActiveForageLocation::GetPolygonref(), gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Population_Manager::m_TheLandscape, Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyPolyRef(), and Population_Manager::TheArray.
Referenced by DoLast().
|
protected |
AOR Probe for barnacles.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
AOR Probe for greylags.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
AOR Probe for pinkfeet.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
Statistics for the daily energy balance in the population.
Referenced by ClearGooseDailyEnergyBalanceStats(), GooseEnergyRecordOutput(), and RecordDailyEnergyBalance().
|
protected |
Statistics for the daily energy budget in the population.
Referenced by ClearGooseDailyEnergyBudgetStats(), GooseEnergyRecordOutput(), and RecordDailyEnergyBudget().
|
protected |
Flag for in daylight hours. Sunrise is always at m_daytime == 0.
Referenced by DoFirst(), and GetIsDaylight().
|
protected |
Number of daylight minutes left.
Referenced by DoFirst(), and GetDaylightLeft().
|
protected |
Holds the time of day. Note that sunrise is at m_daytime == 0.
Referenced by DoFirst(), DoLast(), GetDayTime(), and Goose_Population_Manager().
|
protected |
Statistics for the flight distances in the population.
Referenced by ClearGooseFlightDistanceStats(), GooseEnergyRecordOutput(), and RecordFlightDistance().
|
protected |
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2.
Speed optimisation to hold all potential feeding time increases as a function of flock size
Referenced by GetForageRateDensity(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Statistics for the time spent foraging for the population.
Referenced by ClearGooseForagingTimeStats(), GooseEnergyRecordOutput(), and RecordForagingTime().
|
protected |
Pointer to an output file for goose energetics data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose field forage data.
Referenced by Init(), and ~Goose_Population_Manager().
std::vector<GooseActiveForageLocation> Goose_Population_Manager::m_GooseForageLocations |
Is a list of active goose forage locations where we have geese.
Referenced by AddGeeseToForageLocation(), AddGeeseToForageLocationP(), BirdsShot(), BirdsToShootAtPoly(), DoFirst(), DoLast(), ForageLocationInUse(), GetBirdsAtForageLoc(), GetForageGooseDensity(), GetForageGrazing(), GetForageLocation(), GetForageLocIndex(), GetGrainDensity(), GetMaizeDensity(), GetNumberOfForageLocs(), Graze(), NewForageLocation(), RemoveGeeseFromForageLocation(), RemoveGrainKJ(), RemoveMaizeKJ(), and Goose_Base::st_Forage().
|
protected |
Pointer to an output file for almass version.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose habitat use data, field observation mimic version.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose habitat use data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose individual forage location count data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose leave reason stats data.
Referenced by Init().
|
protected |
Pointer to an output file for goose population data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose weight stats data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose x y data.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Flag to indicate if we are in the greylag hunting season.
Referenced by BirdsShot(), DoFirst(), Goose_Population_Manager(), and InGreylagSeason().
|
protected |
Data for the habitat use, field observation mimic version.
Referenced by ClearGooseHabitatUseFieldObsStats(), GooseHabitatUseFieldObsOutput(), and RecordHabitatUseFieldObs().
|
protected |
Data for the habitat use.
Referenced by ClearGooseHabitatUseStats(), GooseHabitatUseOutput(), and RecordHabitatUse().
|
protected |
Statistics for the number of forage locations visited per goose of the population.
Referenced by ClearIndLocCountStats(), GooseIndLocCountOutput(), and RecordIndForageLoc().
|
protected |
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2.
Referenced by GetFeedingRate(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2.
Referenced by GetMaizeFeedingRate(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Statistics for reasons for leaving the simulation.
Referenced by ClearGooseLeaveReasonStats(), GooseLeaveReasonStatOutput(), and RecordLeaveReason().
|
protected |
Storage for goose numbers. Used when birds are immigrating.
Referenced by DoImmigration(), and GetImmigrationNumbers().
|
protected |
Flag to indicate if we are in the pinkfoot hunting season?
Referenced by BirdsShot(), DoFirst(), Goose_Population_Manager(), and InPinkfootSeason().
|
protected |
The list of roosts
Referenced by DoImmigration(), FindClosestRoost(), GetDistToClosestRoost(), and Goose_Population_Manager().
|
protected |
Debugging code. Statistics for the number of times a state method is called.
Referenced by ClearStateStats(), RecordState(), and StateStatOutput().
|
protected |
Pointer to an output file for state stats data.
Referenced by Init().
|
protected |
Temporary storage for daily goose energetic thermal costs constant for each species.
Referenced by DoFirst(), GetThermalCosts(), and Goose_Population_Manager().
Variate_gen* Goose_Population_Manager::m_variate_generator |
Function to be able to draw randomly from predefined distributions.
Referenced by Goose_Population_Manager(), Goose_Base::StartDay(), and ~Goose_Population_Manager().
|
protected |
Statistics for the weights of the population.
Referenced by ClearGooseWeightStats(), GooseWeightStatOutput(), and RecordWeight().
|
protected |
The observed distribution of young for pink feet.
Referenced by DoImmigration(), and Goose_Population_Manager().